<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{$title}-{$Think.lang.web_name}</title>
    {include file="comm/header"/}
    <style>
        body{opacity: 1}

    </style>
</head>
<body>
{if $member}
<div class="login login-animate">
    <div class="login-box">
        <div class="login-title">
            <h3 style="color: #b5b5b5">登录-{$Think.lang.web_name}</h3>
        </div>
        <form action="/admin_login_ok" method="post" class="login-form">
            <div class="col-sm-12">
                <label class="col-sm-1"></label>
                <div class="col-sm-10">
                    {if isset($admin_list) && is_array($admin_list)}
                    <select class="form-control" name="member_id" id="member_id">
                        {foreach name="admin_list" key="key" id="v" index="i"}
                        <option value="{$v.member_id}" {if $member.member_id == $v.member_id}selected{/if} >{$v.member_user}</option>
                        {/foreach}
                    </select>
                    <input type="hidden" class="form-control" name="member_user" value="{$member.member_user}" placeholder="用户名" required>
                    {else}
                    <input type="text" class="form-control" name="member_user" value="{$member.member_user}" placeholder="用户名" required>
                    {/if}

                </div>
            </div>

            <div class="col-sm-12">
                <label class="col-sm-1"></label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" name="member_password" placeholder="密码" required>
                </div>
            </div>

            <div class="col-sm-12">
                <label class="col-sm-1"></label>
                <div class="col-sm-10">
                    <label style="color: #777;" class="s-label-checkbox">
                        <input type="checkbox" id="logins" name="checked" value="1"><label for="logins" class="fa fa-check"></label> 保持登录状态
                    </label>
                </div>
            </div>

            <div class="col-sm-12">
                <label class="col-sm-1"></label>
                <div class="col-sm-10">
                    <input type="hidden" name="member_id" value="{$member.member_id}">
                    <input type="hidden" name="token"   value="" id="token">
                    <button class="btn btn-primary form-control" style="text-align: center;">登录</button>
                </div>
            </div>

        </form>
    </div>

</div>
{/if}

{include file="comm/footer"/}
<script type="text/javascript">
    $(function () {
        var token = LO.get("token");
        $("#token").val(token);
        var inputs = $(".input_init");
        inputs.on("blur",function (e) {
            if(this.getAttribute("data-type")==="number"){
                this.setAttribute("type","text");
            }
        });
        inputs.on("focus",function (e) {
            if(this.getAttribute("data-type")==="number"){
                this.setAttribute("type","number");
            }
        });
        $("#member_id").on("change",function (e) {
            location.href = "/admin_login/id/"+this.value;
        });
    });
</script>
</body>
</html>